extends Control

@onready var white = $"../white"
# Called when the node enters the scene tree for the first time.
func _ready() -> void:
	set_process_input(true)
	
func _input(event) -> void:
	if event is InputEventKey and event.pressed:
		if event.is_action_pressed("build") and GameUtiles.move_allow:
			if GameUtiles.player_bag.get("home",0) >0 or GameUtiles.ingredients.has("home"):
				print("回家")
				white.show()
				SeManager.play_magic()
				await get_tree().create_timer(5.0).timeout
				get_tree().change_scene_to_file("res://scenes/home.tscn")
			
